<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>享送小哥</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/add-style.css" />
</head>

<body class="bg-f">
    <header class="aui-bar aui-bar-nav aui-bar-light u-aui-bar" id="header">
        <a class="aui-pull-left aui-btn" onclick="api.closeWin();"> <span class="aui-iconfont aui-icon-left"></span> </a>
        <div class="aui-title u-aui-title" v-text="title"></div>
        <a href="javascript:;" class="aui-pull-right" @click="confirm"> 确定 </a>
    </header>

    <!--js-->
    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/app.js"></script>
    <script type="text/javascript" src="../script/vue.js"></script>
    <script>
        apiready = function() {
          var statusBarPos = app.statusBar.pos();
          var headerPos = app.pos('header');

          vObj = new Vue({
              el: "#header",
              data: {
                  title: '',
                  mapIcon: '',
                  addressEventType: 0
              },
              methods: {
                  confirm: function() {
                      api.execScript({
                          frameName: 'address2_content',
                          script: 'vObj.submitAddress()'
                      });
                  }
              }
          })

          if (api.pageParam.type == 0) {
              vObj.title = "请选择发货地址";
              vObj.mapIcon = "widget://images/fh4.png";
              vObj.addressEventType = 0;
          } else {
              vObj.title = "请选择收货地址";
              vObj.mapIcon = "widget://images/fh5.png";
              vObj.addressEventType = 1;
          }

          api.openFrame({
              name: 'address2_content',
              url: 'address2_content.html',
              rect: {
                  x: 0,
                  y: statusBarPos.h + headerPos.h,
                  w: api.winWidth,
                  h: api.winHeight - statusBarPos.h - headerPos.h
              },
              pageParam: {
                  addressData: api.pageParam.ret,
                  mapIcon: vObj.mapIcon,
                  addressEventType: vObj.addressEventType,
                  statusBarPos: statusBarPos,
                  headerPos: headerPos
              },
              bounces: true,
              bgColor: 'rgba(0,0,0,0)',
              vScrollBarEnabled: true,
              hScrollBarEnabled: true
          });
        }
    </script>
</body>

</html>
